<?php $menus = $this->requestAction('/menus/index/1');?>
<div id="topnav" class="primarynav">
	<ul class="jd_menu">
		<?php foreach($menus as $menu) : ?>
			<?php if ($othAuth->group('level') >= $menu['Menu']['access_level']) { ?>
			<li>
				<?php e($html->link($menu['Menu']['name'], $menu['Menu']['url']));?>
					<ul>
						<?php foreach($menu['children'] as $children) :?>
							<li>
								<?php e($html->link($children['Menu']['name'], $children['Menu']['url']));?>
								<ul>
									<?php foreach($children['children'] as $grandchild) :?>
										<li>
											<?php e($html->link($grandchild['Menu']['name'], $grandchild['Menu']['url']));?>
										</li>
									<?php endforeach; ?>
								</ul>
							</li>
						<?php endforeach; ?>
					</ul>
			</li>
			<?php } ?>
		<?php endforeach; ?>
		<li><?php if ($othAuth->sessionValid()) { e($html->link('Logout', '/users/logout', array('class'=>'no-ajax'))); } else { e($html->link('Login', '/users/login', array('class'=>'no-ajax'))); }?></li>
	</ul>
</div>